
//
//  XGConfig.h
//  ChildTravel
//
//  Created by yintr on 15/7/9.
//  Copyright (c) 2015年 asput. All rights reserved.
//

#ifndef ChildTravel_XGConfig_h
#define ChildTravel_XGConfig_h


#endif
#define I_PHPSESSID  [NSString stringWithFormat:@"PHPSESSID=%@",[AppDelegate shareDelegate].userModel.PHPSESSID]

//判断系统版本
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)

//屏幕尺寸，宽，高
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#define ScreenWidth  [[UIScreen mainScreen] bounds].size.width

//判断系统版本
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define IOS11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0)

#define IOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] < 11.0 && [[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)


//判断设备
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
//#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?YES:NO) // Test

#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPhone ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(320, 480), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPad ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(768, 1024), [[UIScreen mainScreen] currentMode].size) : NO)

#define iPadR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1536, 2048), [[UIScreen mainScreen] currentMode].size) : NO)

//判断设备型号
#define UI_IS_LANDSCAPE         ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight)
#define UI_IS_IPAD              ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define UI_IS_IPHONE            ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define UI_IS_IPHONE4           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height < 568.0)
#define UI_IS_IPHONE5           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define UI_IS_IPHONE6           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
#define UI_IS_IPHONE6PLUS       (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0 || [[UIScreen mainScreen] bounds].size.width == 736.0) // Both orientations



//屏幕尺寸，宽，高
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#define ScreenWidth  [[UIScreen mainScreen] bounds].size.width
//打印调试信息
#ifdef DEBUG
#define DMLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define DMLog(...) do { } while (0)
#endif

//颜色16进制
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define btn_bg_color_n UIColorFromRGB(0x70629d)
#define btn_bg_color_s UIColorFromRGB(0xaaa1ce)
#define text_color UIColorFromRGB(0xbfb8da)
#define text_color_tablebar UIColorFromRGB(0x9689c1)
#define layer_border_color UIColorFromRGB(0xcdcdcd)
//文本框背景色
#define vie_textbg_color UIColorFromRGB(0xffffff)
//url参数拼接
#define UrlWithParamter(url) [NSString stringWithFormat:@"%@",url];
#define isHomeImageCacheCleaded @"isHomeImageCacheCleaded"
//分页
#define I_PageSize @"10"

#define kTabBar_Height  49
#define KNav_Heigth 44
#define KStatuBar_Height (KIsiPhoneX ? 44 : 20)

#define KNav_SumHeigth (KNav_Heigth + KStatuBar_Height)

#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#pragma mark --------新增
//屏幕尺寸
#define KSYScreenHeight [[UIScreen mainScreen] bounds].size.height
#define KSYScreenWidth [[UIScreen mainScreen] bounds].size.width

#define KSYScreen_Frame(x,y,w,h) CGRectMake(x,y,w,h)
//屏幕中心
#define KSYView_Center(view) ((view).center)
#define KSYView_Center_X(view) ((view).center.x)
#define KSYView_Center_Y(view) ((view).center.y)
//控件宽高
#define KSYViewFrame_Size_Width(view) ((view).frame.size.width)
#define KSYViewFrame_Size_Height(view) ((view).frame.size.height)
//控件原始坐标
#define KSYViewFrame_Origin_X(view) ((view).frame.origin.x)
#define KSYViewFramen_Origin_Y(view) ((view).frame.origin.y)



//颜色
#define KSYRGB(r, g, b) [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) /255.0) alpha:1.0]
#define KSYRGBAlpha(r, g, b, a) [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:(a)]
//字体大小
#define KSYUIFont(font) [UIFont systemFontOfSize:font]

#define SafeAreaBottomHeight (KSYScreenHeight == 812.0 ? 34 : 0)
#define SafeAreaStatusBarTopHeight (KSYScreenHeight == 812.0 ? 44 : 20)
#define SafeAreaTopHeight (KSYScreenHeight == 812.0 ? 88 : 64)

#define closeSuspensionBox @"closeSuspension"

//#import "ValidateHelper.h"
//集成第三方图片缓存加载
//#import "UIImageView+WebCache.h"

#define URL_PREFIX @"http://api.leqiuba.cc/leqiuba_app/index.php/Api/V1_0/"

#define URL_PREFIX_test @"http://no.leqiuba.cc/leqiuba_app/index.php/Api/V1_0/"

//#define URL_PREFIX @"http://192.168.0.180/leqiuba_app/index.php/Api/V1_0/"


//
//#define URL_PREFIX @"http://bike.yuncaibang.com/app/"
//#define URL_ImgFix @"http://api.leqiuba.cc/leqiuba_app"

#define URL_Host @"http://app.lovearker.com/un-fzjktj-web2/"//@"http://wl.xingguan.net"//

//#define URL_Host @"http://192.168.0.124:8080/un-fzjktj-web/"//@"http://wl.xingguan.net"//

#define FontRegular(fontNum) [UIFont fontWithName:@"PingFang-SC-Regular" size:fontNum]
#define FontBold(fontNum) [UIFont fontWithName:@"PingFang-SC-Medium" size:fontNum]
#define PlaceHolderImg [UIImage imageNamed:@"默认图.jpg"]
#define PlaceHolderUserImg [UIImage imageNamed:@"用户默认头像"]
#define PlaceHolderMangerImg [UIImage imageNamed:@"活动管家"]
#define WeakObj(o) autoreleasepool{} __weak typeof(o) o##Weak = o;


#pragma mark 添加头文件
//添加头文件
#import "AppDelegate.h"



//持久化
#define Key_user @"userData"
#define key_payNotification @"payNotification" 
#define key_weixing @"key_payNotification_weiXin"

#define key_Location @"location"
#define key_Exception @"Exception"
#define key_InfoSelf @"infoSelf"//个人信息
#define key_phone @"servicePhone"//客户电话

#define Key_token @"Tg_sokect_token"

#define key_redNUm @"redNum"

#define key_searchHistory @"mapSearchHistory"
#define key_AdressBookHistory @"adressBookHistory"
#define key_searchPlante @"searchPlante"
#define key_SelectCity @"selectCity"
#define key_SelectRoomPeople @"selectRoomPeople" //选择入住人

#define Socket_PayState @"USER_ORDER_PAY"//用户支付宝或微信支付成功 推给用户的
#define Socket_DriverRecive @"USER_ORDER_GRAB"//司机接单
#define Socket_DriverRunToDis @"USER_ORDER_SETOF"//司机前往
#define Socket_DriverComeDis @"USER_ORDER_ARRIVE"//司机到达预约地点
#define Socket_DriverStartService @"USER_ORDER_BEGIN"//司机开始服务
#define Socket_DriverEndService @"USER_ORDER_ORVER"//司机结束服务

#define KAppDelegateShare ((AppDelegate*)[[UIApplication sharedApplication] delegate])


#define KNotionficationScore @"LeqiubaNotionficationScore"//比分通知

#define KNotionFicationLoginOK @"leqiubaLoginOK" //登录成功
#define KNotionFicationLoginOut @"leqiubaLoginOut" //退出登录
#define KNotionFicationCancelOrder @"leqiubaCancelOrder" //取消预约成功

#define Key_IsTest @"Key_IsTest" //




#define KVideoHeigth ((ScreenWidth / 375.0) * 210)


static NSString *appKey = @"cabf53c021194199bacfe449";
static NSString *appSecrt = @"761f20781de22fef2468cbe6";


//#import "ZxMapView.h"
//
//typedef void(^mapSearchBlock)(AMapPOI *poiData);
//typedef void(^mapSearchBlockSongji)(AMapPOI *poiData,NSString *cityId);




